﻿using System.Collections.Generic;
using OblivionLevelingHelper.Attributes;
using OblivionLevelingHelper.Skills;

namespace OblivionLevelingHelper.Races
{
    public abstract class Race
    {
        public string Name;
        protected readonly Dictionary<SkillTypes, int> SkillModifiers;
        protected readonly Dictionary<AttributeTypes, int> AttributeModifiers;

        protected Race(string name)
        {
            Name = name;
            SkillModifiers = new Dictionary<SkillTypes, int>();
            AttributeModifiers = new Dictionary<AttributeTypes, int>();
        }

        protected void AddSkillModifier(SkillTypes skill, int value)
        {
            SkillModifiers.Add(skill, value);
        }

        protected void AddAttributeModifier(AttributeTypes attribute, int value)
        {
            AttributeModifiers.Add(attribute, value);
        }

        public int GetSkillModifier(SkillTypes skillType)
        {
            return SkillModifiers.ContainsKey(skillType) ? SkillModifiers[skillType] : 0;
        }

        public int GetAttributeModifier(AttributeTypes attribute)
        {
            return AttributeModifiers.ContainsKey(attribute) ? AttributeModifiers[attribute] : 0;
        }
    }
}
